package com.example.bst;

/**
 * 折痕问题
 *
 * @Date 2022/4/6
 * @Created by Jonathan
 */
public class PaperFolding {

    /**
     * 递归过程 来到了某个节点
     * i 是节点的层数 N是一共的层数 down为true是凹 否则是凸
     */
    private void printProcess(int i, int N, boolean down) {
        if (i > N) return;
        printProcess(i + 1, N, true);
        System.out.print(down ? "凹" : "凸");
        printProcess(i + 1, N, false);
    }

    public void printAllFolds(int N) {
        printProcess(1, N, true);
    }

    public static void main(String[] args) {
        PaperFolding folding = new PaperFolding();
        int N = 3;
        folding.printAllFolds(N);
    }
}
